package com.lenovo.smarttraffic.ui.activity.stage2;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;

import com.lenovo.smarttraffic.MainActivity;
import com.lenovo.smarttraffic.R;
import com.lenovo.smarttraffic.ui.activity.BaseActivity;
import com.lenovo.smarttraffic.ui.adapter.CarChargeAdapter;
import com.lenovo.smarttraffic.util.HttpUtils;
import com.lenovo.smarttraffic.util.ToastUtils;
import com.lenovo.smarttraffic.util.Utils;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public class CarChargeActivity extends BaseActivity {

    private List<Integer> mList = new ArrayList<>();

    private ListView mListView;

    @Override
    protected int getLayout() {
        return R.layout.activity_car_charge;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        initView();
        initData();
    }

    public void initView() {
        Toolbar mToolbar = findViewById(R.id.toolbar);
        mToolbar.setNavigationOnClickListener(view -> finish());

        mListView = findViewById(R.id.listview_car_charge);
    }


    public void initData() {
        for (int i = 1; i < 6; i++) {
            mList.add(i);
        }

        mListView.setAdapter(new CarChargeAdapter(this, mList));
    }

}
